#ifndef PROTO_H__
#define PROTO_H__

#define DEFAULT_MGROUP                  "224.2.2.2"
#define DEFAULT_RCVPORT                 "6666"
#define CHNNR                                            100
#define LISTCHNID                                     0
#define MINCHNID                                      1
#define MAXCHNID                                     (CHNNR+MINCHNID -1)
#define MSG_CHANNEL_MAX               (65536 -20 -8) //推荐长度 -ip包的长度 - udp包的报头
#define MAX_DATA                                      (MSG_CHANNEL_MAX  - sizeof(chnid_t))

#define MSG_LIST_MAX                           (65536 -20 -8) //推荐长度 -ip包的长度 - udp包的报头
#define MAX_ENTRY                                   (MSG_LIST_MAX  - sizeof(chnid_t))


#include "sitetype.h"

struct  msg_channel_st
{
   chnid_t  chinid;
  uint8_t data[1];
}__attribute__((packed));

/*  节目包结构体 */
struct  msg_listentry_st
{
    chnid_t chnid;  /* channel num  */
    uint16_t len;
    uint8_t desc[1]; /*  describe channel  information*/

}__attribute__((packed));

/*  总包结构体 包括节目单和节目描述*/
struct  msg_list_st
{
    chnid_t chnid;  /* channel num  */
    struct msg_listentry_st entry[1];

}__attribute__((packed));


#endif